<!doctype html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link href="../css/mui.min.css" rel="stylesheet" />
		<link rel="stylesheet" href="../css/style.css" />
		<script src="../js/head_public.js"></script>
		<script src="../js/common.js"></script>
	</head>

	<body style="background: #f2dfbf;">
		<header class="mui-bar mui-bar-nav ding-bar">
		    <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
		    <h1 class="mui-title">成为合伙人</h1>
		</header>
		<div class="mui-content" style="background: #f2dfbf;">
		<div style="background: url(../images/hehuoren-di.png)no-repeat top;background-size: 100%;">
			<div class="hehuoren-con">
		    	<div class="hehuoren-con-nei">
		    		<img src="../images/zm-banner.png" class="hehuoren-tu"/>
		    		<form class="hehuoren-form">
		    			<p><span>姓名</span><input type="text" name="name" id="username" placeholder="请输入姓名" /></p>
		    			<p><span>身份证号</span><input type="text" name="name" id="usercard" placeholder="请输入身份证号" /></p>
		    			<p><span>手机号</span><input type="text" name="name" id="userphone" placeholder="请输入手机号" /></p>
		    		</form>
		    		<a data-href="hehuoreninfo.html" style="font-size: 14px;color: #ecd6ab;position: absolute;top: 0.5rem;right: -0.3rem;">详情</a>
		    	</div>
		    </div>
		    <button class="tjsq" id="tjsq">提交申请</button>
		</div>		    
		</div>
		<footer></footer>
		<script src="../js/mui.min.js"></script>
		<script src="../js/jquery-1.8.0.min.js"></script>
		<script>
						
		</script>
		<script type="text/javascript">
			mui(".hehuoren-con-nei").on("tap","a",function(){
				mui.openWindow({url:$(this).attr("data-href")})
			})
	        mui(".mui-content").on("tap","#tjsq",function(){
	      	    var userName=$("#username").val();
	      	    var userCard=$("#usercard").val();
	      	    var userPhone=$("#userphone").val();
	      	    var $userName=/^[\u4e00-\u9fa5]{2,4}$/;
	      	    var $userCard=/^\d{6}(18|19|20)?\d{2}(0[1-9]|1[012])(0[1-9]|[12]\d|3[01])\d{3}(\d|X)$/;
	      	    var $userPhone=/^(13[0-9]|14[0-9]|15[0-9]|18[0-9]|17[0-9])\d{8}$/;
	      	    if(userName==null||userName==""){
	      	    	alert("请输入姓名")
	      	    	return false;
	      	    }else if(!$userName.test(userName)){
	      	    	alert("请输入真实姓名");
	      	    	return false;
	      	    }
	      	    if(userCard==null||userCard==""){
	      	    	alert("请输入身份证号")
	      	    	return false;
	      	    }else if(!$userCard.test(userCard)){
	      	    	alert("请输入正确的身份证号");
	      	    	return false;
	      	    }
	      	    if(userPhone==null||userPhone==""){
	      	    	alert("请输入手机号")
	      	    	return false;
	      	    }else if(!$userPhone.test(userPhone)){
	      	    	alert("请输入正确的手机号");
	      	    	return false;
	      	    }
	      	    var data={};
	      	    data.username=userName;
	      	    data.phone=userPhone;
	      	    data.number=userCard;
	      	    $.post(net+"public/index.php?s=api/partner/form_Partner",data,function(data){
		               if(data.code==200){
		               	  alert("合伙人提交申请成功！");
		               	  location.reload()
		                }else{
		                	alert(data.message);
		                }
				    },'json'
				);
	      	    
	        })
		</script>
	</body>

</html>